﻿<!--#include file="../Include/Config.asp"-->
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
<div id="SuveyAdmin">
<table width="100%" align="center" cellpadding="0" cellspacing="0" id="SurveyAdmin" class="table">
<%
dim  sql,order_by,way,page_size,rscount,item_count,page_num,page_now,i
order_by=request.QueryString("order_by")
way=request.QueryString("way")
order_by="Survey_creatDate"
way="desc"
page_size=10
set rscount=conn.execute("select count(*) as item_count from survey")
	item_count=rscount("item_count")
	rscount.close
    page_num=item_count\page_size 
sql="select * from survey order by "&order_by&" "&way&""
rs.open sql,conn,1,3
if not rs.eof then
	rs.pagesize=page_size
	page_now=1
	if trim(request.QueryString("page"))<>"" then
	page_now=cint(trim(request.QueryString("page")))
	end if
	if page_now>rs.pagecount or page_now<0 then
	page_now=1
	end if
	rs.absolutepage=page_now
%>
<tr>
<th>问卷名称</th>
<th>问卷发起者</th>
<th>问卷创建日期</th>
<th>问卷结束日期</th>
<th>通过审核</th>
<th>操作</th>
</tr>
<%
  i=1
  while not rs.eof and i<page_size+1
%>
<tr>
<td><a href="SurveyInfo.asp?Survey_id=<%=rs("Survey_id")%>"><%=rs("Survey_name")%></a></td>
<td><%=rs("Survey_author")%></td>
<td><%=rs("Survey_creatDate")%></td>
<td><%=rs("Survey_dateOver")%></td>
<td><%SwitchBoolean(rs("Survey_isAuditing"))%></td>
<td>
<a href="Survey_Show.asp?Survey_id=<%=rs("Survey_id")%>" target="_blank">预览</a>&nbsp;|
&nbsp;<a href="SurveyInfo.asp?Survey_id=<%=rs("Survey_id")%>">编辑问卷</a>|
&nbsp;<a href="QuestionAdd.asp?Survey_id=<%=rs("Survey_id")%>">添加题目</a>|
&nbsp;<a href="#"onclick="javascript:if (confirm('确认删除&nbsp;?')) href='SurveyDel.asp?Survey_id=<%=rs("Survey_id")%>';else return;">删除</a>
</td>
</tr>
<%
   rs.movenext
   i=i+1
   wend
%>
<tr>
<td colspan="6" align="right">
<div id="bottom_pagebox" style="padding-right:25px;">
当前第<%=page_now%>页
  <%if page_now=1 then%>首页
  <%else%><a href="SurveyAdmin.asp?page=1">首页</a>
  <%end if%>
  <%if page_now>1 and rs.pagecount>1 then%>
  <a href="SurveyAdmin.asp?page=<%=page_now-1%>">上一页</a>
  <%else%>上一页
  <%end if%>				
  <%if page_now<rs.pagecount then%> 
  <a href="SurveyAdmin.asp?page=<%=page_now+1%>">下一页</a>
  <%else%>下一页
  <%end if%>				
  <%if page_now<>rs.pagecount then%> 
  <a href="SurveyAdmin.asp?page=<%=rs.pagecount%>">尾页</a>
  <%else%>尾页
  <%end if%>
  共<%=rs.pagecount%>页/<%=item_count%>篇
</div>
</td>
</tr>
<%else%>
<tr>
<td colspan="6">暂时没有问卷，请<a href="SurveyAdd.asp">添加</a></td>
</tr>
<%
end if
rs.close
%>
</table>
</div>
